<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePermissionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('permission', function (Blueprint $table) {
            $table->engine = 'InnoDB';

            $table->increments('id');
            $table->string('module', 255);
            $table->string('class', 255);
            $table->string('action', 255);
            $table->string('name', 255);
            $table->tinyInteger('display');
            $table->integer('pid');
            $table->integer('sort');
            $table->tinyInteger('level');
            $table->string('mark', 255);
            $table->integer('add_time');
            
            $table->index('module');
            $table->index('class');
            $table->index('action');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('permission');
    }
}
